package com.peza.bikelog.gui.data;

import com.vaadin.data.Container;
import com.vaadin.ui.Table;

public class EntryTable extends Table{

	
	
	
	public EntryTable(String caption, Container datasource){
		super(caption,datasource);
		this.setColumnCollapsingAllowed(true);
		this.addGeneratedColumn("date", new DateColumnGenerator());
		
		Object [] columns = {
				"id",
				"date",
				"description",
				"bike",
				"course",
//				"course.surface",
//				"course.distance",
//				"course.ascent",
				"fitnessData.zone",
				"fitnessData.averageHr",
				"fitnessData.maxHr",
				"fitnessData.recPct",
				"fitnessData.d1Pct",
				"fitnessData.d2Pct",
				"fitnessData.d3Pct",
				"fitnessData.maxPct",
				"fitnessData.kcal"
		};
		this.setVisibleColumns(columns);
		
		this.setColumnHeader("id", "ID");
		this.setColumnHeader("date","DATE");
		this.setColumnHeader("description","BESCHRIJVING");
		this.setColumnHeader("bike","BIKE");
		this.setColumnHeader("course.location","PLAATS");
		this.setColumnHeader("course.surface","SRT");
		this.setColumnHeader("course.distance","KM");
		this.setColumnHeader("course.ascent","HM");
		this.setColumnHeader("fitnessData.zone","ZONE");
		this.setColumnHeader("fitnessData.averageHr","AHB");
		this.setColumnHeader("fitnessData.maxHr","MHB");
		this.setColumnHeader("fitnessData.recPct","REC");
		this.setColumnHeader("fitnessData.d1Pct","D1");
		this.setColumnHeader("fitnessData.d2Pct","D2");
		this.setColumnHeader("fitnessData.d3Pct","D3");
		this.setColumnHeader("fitnessData.maxPct","MAX");
		this.setColumnHeader("fitnessData.kcal","CAL");
	}
	
}
